<?php

class order_total extends a_dynamic_prop {

    public function get_property_name(){
        return $this->_prefix()."order_total";
    }

    public function run( i_base_model $caller){         
        if($caller->id!==NULL){
            $order_service = new service_l_order();
            return $order_service->calculate_order_discounted_total($caller->id);
        }else{
            logger::i()->warning("order id is invalid","order total");
            return 0.00;
        }
    }

    public function for_model(){
        return "order_m_order";
    }

    public function run_once(){
        return FALSE;
    }
}
?>